package com.cleveralgorithm.util;

import junit.framework.TestCase;

public class TestMergeSort extends TestCase {

	public TestMergeSort(String name) {
		super(name);
	}

	protected void setUp() throws Exception {
	}

	protected void tearDown() throws Exception {
	}
	
	public void testRandomSort(){
		
	}
	
	public void testSort(){
		int[] testSet = new int[]{6,2,8,5,2,3,1,4,6,7,2,9,1};
		int[] sortedSet = new int[0]; // store result
		
		sortedSet = MergeSort.sort(testSet);
		
		assertNotNull("Sorted Set Is Null" , sortedSet);
		
		for(int i=0;i<sortedSet.length - 1;i++){
			assertTrue("set is not sorted", sortedSet[i] <= sortedSet[i+1]);
		}
	}

}
